package com.edeweiss.community.domain;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class Student {
    private String sid;
    private String susername;
    private String spassword;
    private String ssex;
    private int sfaculty;
    private String sno;
    private String stelphone;
    private Date sbirthday;

    public String getSid() {
        return sid;
    }

    public void setSid(String sid) {
        this.sid = sid;
    }

    public String getSusername() {
        return susername;
    }

    public void setSusername(String susername) {
        this.susername = susername;
    }

    public String getSpassword() {
        return spassword;
    }

    public void setSpassword(String spassword) {
        this.spassword = spassword;
    }

    public String getSsex() {
        return ssex;
    }

    public void setSsex(String ssex) {
        this.ssex = ssex;
    }

    public int getSfaculty() {
        return sfaculty;
    }

    public void setSfaculty(int sfaculty) {
        this.sfaculty = sfaculty;
    }

    public String getSno() {
        return sno;
    }

    public void setSno(String sno) {
        this.sno = sno;
    }

    public String getStelphone() {
        return stelphone;
    }

    public void setStelphone(String stelphone) {
        this.stelphone = stelphone;
    }

    public void setSbirthday(Date sbirthday) {
        this.sbirthday = sbirthday;
    }

    public Date getSbirthday() { return sbirthday; }

    public void setBirthday(String birthday) {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        try{
            this.sbirthday=sdf.parse(birthday);
        }catch (ParseException e) {
            e.printStackTrace();
        }
    }

    @Override
    public String toString() {
        return "Student{" +
                "sid='" + sid + '\'' +
                ", susername='" + susername + '\'' +
                ", spassword='" + spassword + '\'' +
                ", ssex='" + ssex + '\'' +
                ", sfaculty=" + sfaculty +
                ", sno='" + sno + '\'' +
                ", stelphone='" + stelphone + '\'' +
                ", sbirthday=" + sbirthday +
                '}';
    }
}
